import { defineStore } from 'pinia'
import { ref } from 'vue'

export default defineStore('cityCode', () => {
    const cityCode = ref<string | null>(null)
    const setCityCode = (val: string) => (cityCode.value = val)
    return { cityCode, setCityCode }
  },
  {
    persist: {
      storage: {
        getItem: (key) => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value),
      },
    },
  },
)
